﻿namespace ExamV5.RubricInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmShowCountRubricInfo : Page
    {
        protected Button butClose;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        protected Label labAACount;
        protected Label labABCount;
        protected Label labACCount;
        protected Label labACount;
        protected Label labADCount;
        protected Label labAECount;
        protected Label labAFCount;
        protected Label labAGCount;
        protected Label labAHCount;
        protected Label labAICount;
        protected Label labAJCount;
        protected Label labBACount;
        protected Label labBBCount;
        protected Label labBCCount;
        protected Label labBCount;
        protected Label labBDCount;
        protected Label labBECount;
        protected Label labBFCount;
        protected Label labBGCount;
        protected Label labBHCount;
        protected Label labBICount;
        protected Label labBJCount;
        protected Label labCACount;
        protected Label labCBCount;
        protected Label labCCCount;
        protected Label labCCount;
        protected Label labCDCount;
        protected Label labCECount;
        protected Label labCFCount;
        protected Label labCGCount;
        protected Label labCHCount;
        protected Label labCICount;
        protected Label labCJCount;
        protected Label labCountInfo;
        protected Label labDACount;
        protected Label labDBCount;
        protected Label labDCCount;
        protected Label labDCount;
        protected Label labDDCount;
        protected Label labDECount;
        protected Label labDFCount;
        protected Label labDGCount;
        protected Label labDHCount;
        protected Label labDICount;
        protected Label labDJCount;
        protected Label labEACount;
        protected Label labEBCount;
        protected Label labECCount;
        protected Label labECount;
        protected Label labEDCount;
        protected Label labEECount;
        protected Label labEFCount;
        protected Label labEGCount;
        protected Label labEHCount;
        protected Label labEICount;
        protected Label labEJCount;
        protected Label labSubjectName;
        private PublicFun publicFun_0 = new PublicFun();

        private void method_0()
        {
            try
            {
                SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
                connection.Open();
                int num = 0;
                SqlCommand command = new SqlCommand("select Count(*) as CountInfo,b.SubjectName,a.Flag from RubricInfo a,SubjectInfo b  where  a.IsDel='N' and b.ID=a.SubjectID and b.ID=" + this.int_0 + " group by b.SubjectName,a.Flag", connection);
                SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                while (reader.Read())
                {
                    this.labSubjectName.Text = reader["SubjectName"].ToString();
                    num += Convert.ToInt32(reader["CountInfo"].ToString());
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "Count")).Text = "<font color=red>" + reader["CountInfo"].ToString() + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "ACount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='A'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "BCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='B'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "CCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='C'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "DCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='D'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "ECount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='E'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "FCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='F'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "GCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='G'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "HCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='H'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "ICount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='I'" }), "CountInfo") + "道</font>";
                    ((Label) this.FindControl("lab" + reader["Flag"].ToString() + "JCount")).Text = "<font color=red>" + this.publicFun_0.GetValues(string.Concat(new object[] { "select Count(*) as CountInfo from RubricInfo where SubjectID=", this.int_0, " and  IsDel='N' and Flag='", reader["Flag"].ToString(), "' and RubricType='J'" }), "CountInfo") + "道</font>";
                }
                this.labCountInfo.Text = num.ToString() + "道";
                reader.Close();
                command.Dispose();
                connection.Close();
                connection.Dispose();
            }
            catch
            {
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            this.int_0 = Convert.ToInt32(base.Request["ID"].ToString());
            if ((this.httpCookie_0 != null) && !(this.httpCookie_0.Value == ""))
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                if (!base.IsPostBack)
                {
                    if (this.publicFun_0.ReturnPaperData() != "Yes")
                    {
                        base.Response.Write("<script>alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')</script>");
                    }
                    else if (!((this.int_0 != 0) ? !(this.httpCookie_2.Value != "A") : true))
                    {
                        this.method_0();
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

